package cn.elead.it.template.config;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;

import cn.elead.it.common.mybatisplus.CommonMetaObjectHandler;
import cn.elead.it.common.mybatisplus.MybatisPlusSqlInjector;

/**
 * @author luopeng
 * @since 2019-08-03
 */
@Configuration
@MapperScan("cn.elead.it.learn.**.dao")
public class MybatisPlusConfig {

	 /**
     * 分页
     *
     * @return
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }


    /**
     * 自动填充
     *
     * @return
     */
    @Bean
    public CommonMetaObjectHandler commonMetaObjectHandler() {
        return new CommonMetaObjectHandler();
    }

    /**
     * 自定义注入语句
     *
     * @return
     */
    @Bean
    public MybatisPlusSqlInjector mybatisPlusSqlInjector() {
        return new MybatisPlusSqlInjector();
    }
}
